<%--
  Created by IntelliJ IDEA.
  User: bbb304
  Date: 2025/11/2
  Time: 15:00
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <title>添加员工</title>
  <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/style.css">
</head>
<body>
<div class="container">
  <header>
    <h1>员工信息管理系统</h1>
    <div class="user-info">
      欢迎, ${sessionScope.username} |
      < a href=" ">退出</ a>
</div>
</header>

<nav>
  <ul>
    <li>< a href="${pageContext.request.contextPath}/dashboard">首页</ a></li>
    <li>< a href="${pageContext.request.contextPath}/employees">员工管理</ a></li>
  </ul>
</nav>

<main>
  <div class="page-header">
    <h2>添加新员工</h2>
    < a href="${pageContext.request.contextPath}/employees" class="btn btn-secondary">返回列表</ a>
  </div>

  <form action="${pageContext.request.contextPath}/employees" method="post" class="employee-form">
    <input type="hidden" name="action" value="insert">

    <div class="form-group">
      <label for="name">姓名:</label>
      <input type="text" id="name" name="name" required>
    </div>

    <div class="form-group">
      <label for="department">部门:</label>
      <select id="department" name="department" required>
        <option value="">请选择部门</option>
        <option value="技术部">技术部</option>
        <option value="市场部">市场部</option>
        <option value="人事部">人事部</option>
        <option value="财务部">财务部</option>
        <option value="行政部">行政部</option>
      </select>
    </div>

    <div class="form-group">
      <label for="position">职位:</label>
      <input type="text" id="position" name="position" required>
    </div>

    <div class="form-group">
      <label for="salary">薪资:</label>
      <input type="number" id="salary" name="salary" step="0.01" required>
    </div>

    <div class="form-group">
      <label for="email">邮箱:</label>
      <input type="email" id="email" name="email">
    </div>

    <div class="form-group">
      <label for="phone">电话:</label>
      <input type="tel" id="phone" name="phone">
    </div>

    <div class="form-group">
      <label for="hireDate">入职日期:</label>
      <input type="date" id="hireDate" name="hireDate" required>
    </div>

    <div class="form-actions">
      <button type="submit" class="btn btn-primary">添加员工</button>
      < a href="${pageContext.request.contextPath}/employees" class="btn btn-secondary">取消</ a>
    </div>
  </form>
</main>
</div>
</body>
</html>
